package com.zyc.app.woa;

import android.os.Environment;
import com.zyc.app.woa.utils.StorageUtils;

import java.io.File;

/**
 * Author: yingchang.zhang
 * Date  : 2014/11/25
 */
public class WxConfig {
    public static final String TAG = "WxArticle";
    public static final String ARTICLES = "articles";
    public static final String FAVORITES = "favorites";
    public static final String PICS = "pics";
    public static final String DEFAULT_ID = "noId";
    public static final String ACCOUNT_INFO = "accountInfo";
    public static final String ARTICLE_INFO = "articleInfo";
    public static final int DEFAULT_DOWNLOAD_SIZE = 20;
    public static final int MB_SIZE = 1024 * 1024;
    public static final int MAX_CACHE_SIZE = 30 * MB_SIZE;

    public static final String CACHE_ROOT_PATH = Environment.getExternalStorageDirectory() + File.separator + TAG;
    public static final String ARTICLE_CACHE_PATH = CACHE_ROOT_PATH + File.separator + ARTICLES;
    public static final String FAVORITES_CACHE_PATH = CACHE_ROOT_PATH + File.separator + FAVORITES;
    public static final String CACHE_PICS_PATH = CACHE_ROOT_PATH + File.separator + PICS;

    static {
        StorageUtils.createPathIfNotExist(CACHE_ROOT_PATH);
        StorageUtils.createPathIfNotExist(ARTICLE_CACHE_PATH);
        StorageUtils.createPathIfNotExist(FAVORITES_CACHE_PATH);
        StorageUtils.createPathIfNotExist(CACHE_PICS_PATH);
    }


}
